public class Example {
    public static void main(String[] args) {
        try {
            // 初始化转换工厂
            ConverterFactory factory = new ConverterFactory();
            
            // 注册转换器
            factory.registerConverter(new ExcelToImageConverter());
            
            // 创建转换配置
            ConversionConfig config = new ConversionConfig.Builder()
                    .quality(90)
                    .preserveMetadata(true)
                    .addCustomParam("cellWidth", "100")
                    .addCustomParam("cellHeight", "25")
                    .build();
            
            // Excel转PNG示例
            File excelFile = new File("report.xlsx");
            File pngFile = new File("report.png");
            
            Converter converter = factory.getConverter(FileFormat.XLSX, FileFormat.PNG);
            converter.convert(excelFile, pngFile, config);
            
            System.out.println("转换完成！");
        } catch (ConversionException e) {
            System.err.println("转换失败：" + e.getMessage());
        }
    }
} 